home *** CD-ROM | disk | FTP | other *** search
/ MacWorld 2000 February / Macworld (2000-02).dmg / Updaters / WhiteCap 3.2.2.sea / WhiteCap 3.2.2 / WhiteCap Source / DirectX3 SDK / inc / dplay.h < prev    next >
Text File  |  1996-09-04  |  40KB  |  1,067 lines

  1. /*==========================================================================;
  2.  *
  3.  *  Copyright (C) 1994-1996 Microsoft Corporation.  All Rights Reserved.
  4.  *
  5.  *  File:       dplay.h
  6.  *  Content:    DirectPlay include file
  7.  *
  8.  ***************************************************************************/
  9.  
  10. #ifndef __DPLAY_INCLUDED__
  11. #define __DPLAY_INCLUDED__
  12.  
  13. #include <ole2.h>       // for DECLARE_INTERFACE and HRESULT
  14.  
  15. #define _FACDP  0x877
  16. #define MAKE_DPHRESULT( code )    MAKE_HRESULT( 1, _FACDP, code )
  17.  
  18. #ifdef __cplusplus
  19. extern "C" {
  20. #endif
  21.  
  22. /*
  23.  * GUIDS used by DirectPlay objects
  24.  */
  25. DEFINE_GUID(IID_IDirectPlay2, 0x2b74f7c0, 0x9154, 0x11cf, 0xa9, 0xcd, 0x0, 0xaa, 0x0, 0x68, 0x86, 0xe3);
  26. DEFINE_GUID(IID_IDirectPlay2A,0x9d460580, 0xa822, 0x11cf, 0x96, 0xc, 0x0, 0x80, 0xc7, 0x53, 0x4e, 0x82);
  27.  
  28.  
  29. /****************************************************************************
  30.  *
  31.  * DirectPlay Structures
  32.  *
  33.  * Various structures used to invoke DirectPlay.
  34.  *
  35.  ****************************************************************************/
  36.  
  37. #ifndef IDIRECTPLAY2_OR_GREATER
  38. typedef struct IDirectPlay        FAR *LPDIRECTPLAY;
  39. #else
  40. typedef struct IUnknown           FAR *LPDIRECTPLAY;
  41. #endif
  42.  
  43. typedef struct IDirectPlay2       FAR *LPDIRECTPLAY2;
  44. typedef struct IDirectPlay2       FAR *LPDIRECTPLAY2A;
  45. typedef struct IDirectPlay2       IDirectPlay2A;
  46.  
  47. /*
  48.  * DPID
  49.  * DirectPlay player and group ID
  50.  */
  51. typedef DWORD DPID, FAR *LPDPID;
  52.  
  53. /*
  54.  * DPID that system messages come from
  55.  */
  56. #define DPID_SYSMSG         0
  57.  
  58. /*
  59.  * DPID representing all players in the session
  60.  */
  61. #define DPID_ALLPLAYERS     0
  62.  
  63. /*
  64.  * DPCAPS
  65.  * Used to obtain the capabilities of a DirectPlay object
  66.  */
  67. typedef struct
  68. {
  69.     DWORD dwSize;               // Size of structure, in bytes
  70.     DWORD dwFlags;              // DPCAPS_xxx flags
  71.     DWORD dwMaxBufferSize;      // Maximum message size, in bytes,  for this service provider
  72.     DWORD dwMaxQueueSize;       // Obsolete. 
  73.     DWORD dwMaxPlayers;         // Maximum players/groups (local + remote)
  74.     DWORD dwHundredBaud;        // Bandwidth in 100 bits per second units; 
  75.                                 // i.e. 24 is 2400, 96 is 9600, etc.
  76.     DWORD dwLatency;            // Estimated latency; 0 = unknown
  77.     DWORD dwMaxLocalPlayers;    // Maximum # of locally created players allowed
  78.     DWORD dwHeaderLength;       // Maximum header length, in bytes, on messages
  79.                                 // added by the service provider
  80.     DWORD dwTimeout;            // Service provider's suggested timeout value
  81.                                 // This is how long DirectPlay will wait for 
  82.                                 // responses to system messages
  83. } DPCAPS, FAR *LPDPCAPS;
  84.  
  85. /*
  86.  * This DirectPlay object is the session host.  If the host exits the
  87.  * session, another application will become the host and receive a
  88.  * DPSYS_HOST system message.
  89.  */
  90. #define DPCAPS_ISHOST               0x00000002
  91.  
  92. /*
  93.  * The service provider bound to this DirectPlay object can optimize
  94.  * group messaging.
  95.  */
  96. #define DPCAPS_GROUPOPTIMIZED       0x00000008
  97.  
  98. /*
  99.  * The service provider bound to this DirectPlay object can optimize
  100.  * keep alives (see DPSESSION_KEEPALIVE)
  101.  */
  102. #define DPCAPS_KEEPALIVEOPTIMIZED   0x00000010
  103.  
  104. /*
  105.  * The service provider bound to this DirectPlay object can optimize
  106.  * guaranteed message delivery.
  107.  */
  108. #define DPCAPS_GUARANTEEDOPTIMIZED  0x00000020
  109.  
  110. /*
  111.  * This DirectPlay object supports guaranteed message delivery.
  112.  */
  113. #define DPCAPS_GUARANTEEDSUPPORTED  0x00000040
  114.  
  115.  
  116.  
  117.  
  118. /*
  119.  * DPSESSIONDESC2
  120.  * Used to describe the properties of a DirectPlay
  121.  * session instance
  122.  */
  123. typedef struct
  124. {
  125.     DWORD   dwSize;             // Size of structure
  126.     DWORD   dwFlags;            // DPSESSION_xxx flags
  127.     GUID    guidInstance;       // ID for the session instance
  128.     GUID    guidApplication;    // GUID of the DirectPlay application.
  129.                                 // GUID_NULL for all applications.
  130.     DWORD   dwMaxPlayers;       // Maximum # players allowed in session
  131.     DWORD   dwCurrentPlayers;   // Current # players in session (read only)
  132.     union
  133.     {                           // Name of the session
  134.         LPWSTR  lpszSessionName;    // Unicode
  135.         LPSTR   lpszSessionNameA;   // ANSI
  136.     };
  137.     union
  138.     {                           // Password of the session (optional)
  139.         LPWSTR  lpszPassword;       // Unicode
  140.         LPSTR   lpszPasswordA;      // ANSI
  141.     };
  142.     DWORD   dwReserved1;        // Reserved for future MS use.
  143.     DWORD   dwReserved2;
  144.     DWORD   dwUser1;            // For use by the application
  145.     DWORD   dwUser2;
  146.     DWORD   dwUser3;
  147.     DWORD   dwUser4;
  148. } DPSESSIONDESC2, FAR *LPDPSESSIONDESC2;
  149.  
  150. /*
  151.  * LPCDPSESSIONDESC2
  152.  * A constant pointer to DPSESSIONDESC2
  153.  */
  154. typedef const DPSESSIONDESC2 FAR *LPCDPSESSIONDESC2;
  155.  
  156. /*
  157.  * Applications cannot create new players in this session.
  158.  */
  159. #define DPSESSION_NEWPLAYERSDISABLED    0x00000001 
  160.  
  161. /*
  162.  * If the DirectPlay object that created the session, the host,
  163.  * quits, then the host will attempt to migrate to another
  164.  * DirectPlay object so that new players can continue to be created
  165.  * and new applications can join the session.
  166.  */
  167. #define DPSESSION_MIGRATEHOST           0x00000004
  168.  
  169. /*
  170.  * This flag tells DirectPlay not to set the idPlayerTo and idPlayerFrom 
  171.  * fields in player messages.  This cuts two DWORD's off the message 
  172.  * overhead.
  173.  */
  174. #define DPSESSION_NOMESSAGEID           0x00000008
  175.  
  176.  
  177. /*
  178.  * This flag tells DirectPlay to not allow any new applications to
  179.  * join the session.  Applications already in the session can still
  180.  * create new players.
  181.  */
  182. #define DPSESSION_JOINDISABLED          0x00000020
  183.  
  184. /*
  185.  * This flag tells DirectPlay to detect when remote players 
  186.  * exit abnormally (e.g. their computer or modem gets unplugged)
  187.  */
  188. #define DPSESSION_KEEPALIVE             0x00000040
  189.  
  190. /*
  191.  * This flag tells DirectPlay not to send a message to all players
  192.  *      when a players remote data changes
  193.  */
  194. #define DPSESSION_NODATAMESSAGES        0x00000080
  195.  
  196. /*
  197.  * DPNAME
  198.  * Used to hold the name of a DirectPlay entity
  199.  * like a player or a group
  200.  */
  201. typedef struct 
  202. {
  203.     DWORD   dwSize;             // Size of structure
  204.     DWORD   dwFlags;            // Not used. Must be zero.
  205.     union
  206.     {                           // The short or friendly name
  207.         LPWSTR  lpszShortName;      // Unicode
  208.         LPSTR   lpszShortNameA;     // ANSI
  209.     };
  210.     union
  211.     {                           // The long or formal name
  212.         LPWSTR  lpszLongName;       // Unicode
  213.         LPSTR   lpszLongNameA;      // ANSI
  214.     };
  215.  
  216. } DPNAME, FAR *LPDPNAME;
  217.  
  218. /*
  219.  * LPCDPNAME
  220.  * A constant pointer to DPNAME
  221.  */
  222. typedef const DPNAME FAR *LPCDPNAME;
  223.  
  224.  
  225. /****************************************************************************
  226.  *
  227.  * Prototypes for DirectPlay callback functions
  228.  *
  229.  ****************************************************************************/
  230.  
  231. /*
  232.  * Callback for IDirectPlay2::EnumSessions
  233.  */
  234. typedef BOOL (FAR PASCAL * LPDPENUMSESSIONSCALLBACK2)(
  235.     LPCDPSESSIONDESC2   lpThisSD,
  236.     LPDWORD             lpdwTimeOut,
  237.     DWORD               dwFlags,
  238.     LPVOID              lpContext );
  239.  
  240. /*
  241.  * This flag is set on the EnumSessions callback dwFlags parameter when
  242.  * the time out has occurred. There will be no session data for this 
  243.  * callback. If *lpdwTimeOut is set to a non-zero value and the 
  244.  * EnumSessionsCallback function returns TRUE then EnumSessions will 
  245.  * continue waiting until the next timeout occurs. Timeouts are in 
  246.  * milliseconds.
  247.  */
  248. #define DPESC_TIMEDOUT          0x00000001
  249.  
  250.  
  251. /*
  252.  * Callback for IDirectPlay2::EnumPlayers
  253.  *              IDirectPlay2::EnumGroups
  254.  *              IDirectPlay2::EnumGroupPlayers
  255.  */
  256. typedef BOOL (FAR PASCAL *LPDPENUMPLAYERSCALLBACK2)(
  257.     DPID            dpId,
  258.     DWORD           dwPlayerType,
  259.     LPCDPNAME       lpName,
  260.     DWORD           dwFlags,
  261.     LPVOID          lpContext );
  262.  
  263.  
  264. /*
  265.  * Unicode callback for DirectPlayEnumerate
  266.  * This callback prototype will be used if compiling
  267.  * for Unicode strings
  268.  */
  269. typedef BOOL (FAR PASCAL * LPDPENUMDPCALLBACK)(
  270.     LPGUID      lpguidSP,
  271.     LPWSTR      lpSPName,
  272.     DWORD       dwMajorVersion,
  273.     DWORD       dwMinorVersion,
  274.     LPVOID      lpContext);
  275.  
  276. /*
  277.  * ANSI callback for DirectPlayEnumerate
  278.  * This callback prototype will be used if compiling
  279.  * for ANSI strings
  280.  */
  281. typedef BOOL (FAR PASCAL * LPDPENUMDPCALLBACKA)(
  282.     LPGUID      lpguidSP,
  283.     LPSTR       lpSPName,
  284.     DWORD       dwMajorVersion,     
  285.     DWORD       dwMinorVersion,
  286.     LPVOID      lpContext);
  287.  
  288. /*
  289.  * API's
  290.  */
  291.  
  292. #ifdef UNICODE
  293. #define DirectPlayEnumerate     DirectPlayEnumerateW
  294. #else
  295. #define DirectPlayEnumerate     DirectPlayEnumerateA
  296. #endif // UNICODE
  297.  
  298. extern HRESULT WINAPI DirectPlayEnumerateA( LPDPENUMDPCALLBACKA, LPVOID );
  299. extern HRESULT WINAPI DirectPlayEnumerateW( LPDPENUMDPCALLBACK, LPVOID );
  300. extern HRESULT WINAPI DirectPlayCreate( LPGUID lpGUID, LPDIRECTPLAY *lplpDP, IUnknown *pUnk);
  301.  
  302. /****************************************************************************
  303.  *
  304.  * IDirectPlay2 (and IDirectPlay2A) Interface
  305.  *
  306.  ****************************************************************************/
  307.  
  308. #undef INTERFACE
  309. #define INTERFACE IDirectPlay2
  310. DECLARE_INTERFACE_( IDirectPlay2, IUnknown )
  311. {
  312.     /*** IUnknown methods ***/
  313.     STDMETHOD(QueryInterface)       (THIS_ REFIID riid, LPVOID * ppvObj) PURE;
  314.     STDMETHOD_(ULONG,AddRef)        (THIS)  PURE;
  315.     STDMETHOD_(ULONG,Release)       (THIS) PURE;
  316.     /*** IDirectPlay2 methods ***/
  317.     STDMETHOD(AddPlayerToGroup)     (THIS_ DPID, DPID) PURE;
  318.     STDMETHOD(Close)                (THIS) PURE;
  319.     STDMETHOD(CreateGroup)          (THIS_ LPDPID,LPDPNAME,LPVOID,DWORD,DWORD) PURE;
  320.     STDMETHOD(CreatePlayer)         (THIS_ LPDPID,LPDPNAME,HANDLE,LPVOID,DWORD,DWORD) PURE;
  321.     STDMETHOD(DeletePlayerFromGroup)(THIS_ DPID,DPID) PURE;
  322.     STDMETHOD(DestroyGroup)         (THIS_ DPID) PURE;
  323.     STDMETHOD(DestroyPlayer)        (THIS_ DPID) PURE;
  324.     STDMETHOD(EnumGroupPlayers)     (THIS_ DPID,LPGUID,LPDPENUMPLAYERSCALLBACK2,LPVOID,DWORD) PURE;
  325.     STDMETHOD(EnumGroups)           (THIS_ LPGUID,LPDPENUMPLAYERSCALLBACK2,LPVOID,DWORD) PURE;
  326.     STDMETHOD(EnumPlayers)          (THIS_ LPGUID,LPDPENUMPLAYERSCALLBACK2,LPVOID,DWORD) PURE;
  327.     STDMETHOD(EnumSessions)         (THIS_ LPDPSESSIONDESC2,DWORD,LPDPENUMSESSIONSCALLBACK2,LPVOID,DWORD) PURE;
  328.     STDMETHOD(GetCaps)              (THIS_ LPDPCAPS,DWORD) PURE;
  329.     STDMETHOD(GetGroupData)         (THIS_ DPID,LPVOID,LPDWORD,DWORD) PURE;
  330.     STDMETHOD(GetGroupName)         (THIS_ DPID,LPVOID,LPDWORD) PURE;
  331.     STDMETHOD(GetMessageCount)      (THIS_ DPID, LPDWORD) PURE;
  332.     STDMETHOD(GetPlayerAddress)     (THIS_ DPID,LPVOID,LPDWORD) PURE;
  333.     STDMETHOD(GetPlayerCaps)        (THIS_ DPID,LPDPCAPS,DWORD) PURE;
  334.     STDMETHOD(GetPlayerData)        (THIS_ DPID,LPVOID,LPDWORD,DWORD) PURE;
  335.     STDMETHOD(GetPlayerName)        (THIS_ DPID,LPVOID,LPDWORD) PURE;
  336.     STDMETHOD(GetSessionDesc)       (THIS_ LPVOID,LPDWORD) PURE;
  337.     STDMETHOD(Initialize)           (THIS_ LPGUID) PURE;
  338.     STDMETHOD(Open)                 (THIS_ LPDPSESSIONDESC2,DWORD) PURE;
  339.     STDMETHOD(Receive)              (THIS_ LPDPID,LPDPID,DWORD,LPVOID,LPDWORD) PURE;
  340.     STDMETHOD(Send)                 (THIS_ DPID, DPID, DWORD, LPVOID, DWORD) PURE;
  341.     STDMETHOD(SetGroupData)         (THIS_ DPID,LPVOID,DWORD,DWORD) PURE;
  342.     STDMETHOD(SetGroupName)         (THIS_ DPID,LPDPNAME,DWORD) PURE;
  343.     STDMETHOD(SetPlayerData)        (THIS_ DPID,LPVOID,DWORD,DWORD) PURE;
  344.     STDMETHOD(SetPlayerName)        (THIS_ DPID,LPDPNAME,DWORD) PURE;
  345.     STDMETHOD(SetSessionDesc)       (THIS_ LPDPSESSIONDESC2,DWORD) PURE;
  346. };
  347.  
  348. /****************************************************************************
  349.  *
  350.  * IDirectPlay2 interface macros
  351.  *
  352.  ****************************************************************************/
  353.  
  354. #if !defined(__cplusplus) || defined(CINTERFACE)
  355.  
  356. #define IDirectPlay2_QueryInterface(p,a,b)          (p)->lpVtbl->QueryInterface(p,a,b)
  357. #define IDirectPlay2_AddRef(p)                      (p)->lpVtbl->AddRef(p)
  358. #define IDirectPlay2_Release(p)                     (p)->lpVtbl->Release(p)
  359. #define IDirectPlay2_AddPlayerToGroup(p,a,b)        (p)->lpVtbl->AddPlayerToGroup(p,a,b)
  360. #define IDirectPlay2_Close(p)                       (p)->lpVtbl->Close(p)
  361. #define IDirectPlay2_CreateGroup(p,a,b,c,d,e)       (p)->lpVtbl->CreateGroup(p,a,b,c,d,e)
  362. #define IDirectPlay2_CreatePlayer(p,a,b,c,d,e,f)    (p)->lpVtbl->CreatePlayer(p,a,b,c,d,e,f)
  363. #define IDirectPlay2_DeletePlayerFromGroup(p,a,b)   (p)->lpVtbl->DeletePlayerFromGroup(p,a,b)
  364. #define IDirectPlay2_DestroyGroup(p,a)              (p)->lpVtbl->DestroyGroup(p,a)
  365. #define IDirectPlay2_DestroyPlayer(p,a)             (p)->lpVtbl->DestroyPlayer(p,a)
  366. #define IDirectPlay2_EnableNewPlayers(p,a)          (p)->lpVtbl->EnableNewPlayers(p,a)
  367. #define IDirectPlay2_EnumGroupPlayers(p,a,b,c,d,e)  (p)->lpVtbl->EnumGroupPlayers(p,a,b,c,d,e)
  368. #define IDirectPlay2_EnumGroups(p,a,b,c,d)          (p)->lpVtbl->EnumGroups(p,a,b,c,d)
  369. #define IDirectPlay2_EnumPlayers(p,a,b,c,d)         (p)->lpVtbl->EnumPlayers(p,a,b,c,d)
  370. #define IDirectPlay2_EnumSessions(p,a,b,c,d,e)      (p)->lpVtbl->EnumSessions(p,a,b,c,d,e)
  371. #define IDirectPlay2_GetCaps(p,a,b)                 (p)->lpVtbl->GetCaps(p,a,b)
  372. #define IDirectPlay2_GetMessageCount(p,a,b)         (p)->lpVtbl->GetMessageCount(p,a,b)
  373. #define IDirectPlay2_GetGroupData(p,a,b,c,d)        (p)->lpVtbl->GetGroupData(p,a,b,c,d)
  374. #define IDirectPlay2_GetGroupName(p,a,b,c)          (p)->lpVtbl->GetGroupName(p,a,b,c)
  375. #define IDirectPlay2_GetPlayerAddress(p,a,b,c)      (p)->lpVtbl->GetPlayerAddress(p,a,b,c)
  376. #define IDirectPlay2_GetPlayerCaps(p,a,b,c)         (p)->lpVtbl->GetPlayerCaps(p,a,b,c)
  377. #define IDirectPlay2_GetPlayerData(p,a,b,c,d)       (p)->lpVtbl->GetPlayerData(p,a,b,c,d)
  378. #define IDirectPlay2_GetPlayerName(p,a,b,c)         (p)->lpVtbl->GetPlayerName(p,a,b,c)
  379. #define IDirectPlay2_GetSessionDesc(p,a,b)          (p)->lpVtbl->GetSessionDesc(p,a,b)
  380. #define IDirectPlay2_Initialize(p,a)                (p)->lpVtbl->Initialize(p,a)
  381. #define IDirectPlay2_Open(p,a,b)                    (p)->lpVtbl->Open(p,a,b)
  382. #define IDirectPlay2_Receive(p,a,b,c,d,e)           (p)->lpVtbl->Receive(p,a,b,c,d,e)
  383. #define IDirectPlay2_Send(p,a,b,c,d,e)              (p)->lpVtbl->Send(p,a,b,c,d,e)
  384. #define IDirectPlay2_SetGroupData(p,a,b,c,d)        (p)->lpVtbl->SetGroupData(p,a,b,c,d)
  385. #define IDirectPlay2_SetGroupName(p,a,b,c)          (p)->lpVtbl->SetGroupName(p,a,b,c)
  386. #define IDirectPlay2_SetPlayerData(p,a,b,c,d)       (p)->lpVtbl->SetPlayerData(p,a,b,c,d)
  387. #define IDirectPlay2_SetPlayerName(p,a,b,c)         (p)->lpVtbl->SetPlayerName(p,a,b,c)
  388. #define IDirectPlay2_SetSessionDesc(p,a,b)          (p)->lpVtbl->SetSessionDesc(p,a,b)
  389.  
  390. #else /* C++ */
  391.  
  392. #define IDirectPlay2_QueryInterface(p,a,b)          (p)->QueryInterface(a,b)
  393. #define IDirectPlay2_AddRef(p)                      (p)->AddRef()
  394. #define IDirectPlay2_Release(p)                     (p)->Release()
  395. #define IDirectPlay2_AddPlayerToGroup(p,a,b)        (p)->AddPlayerToGroup(a,b)
  396. #define IDirectPlay2_Close(p)                       (p)->Close()
  397. #define IDirectPlay2_CreateGroup(p,a,b,c,d,e)       (p)->CreateGroup(a,b,c,d,e)
  398. #define IDirectPlay2_CreatePlayer(p,a,b,c,d,e,f)    (p)->CreatePlayer(a,b,c,d,e,f)
  399. #define IDirectPlay2_DeletePlayerFromGroup(p,a,b)   (p)->DeletePlayerFromGroup(a,b)
  400. #define IDirectPlay2_DestroyGroup(p,a)              (p)->DestroyGroup(a)
  401. #define IDirectPlay2_DestroyPlayer(p,a)             (p)->DestroyPlayer(a)
  402. #define IDirectPlay2_EnableNewPlayers(p,a)          (p)->EnableNewPlayers(a)
  403. #define IDirectPlay2_EnumGroupPlayers(p,a,b,c,d,e)  (p)->EnumGroupPlayers(a,b,c,d,e)
  404. #define IDirectPlay2_EnumGroups(p,a,b,c,d)          (p)->EnumGroups(a,b,c,d)
  405. #define IDirectPlay2_EnumPlayers(p,a,b,c,d)         (p)->EnumPlayers(a,b,c,d)
  406. #define IDirectPlay2_EnumSessions(p,a,b,c,d,e)      (p)->EnumSessions(a,b,c,d,e)
  407. #define IDirectPlay2_GetCaps(p,a,b)                 (p)->GetCaps(a,b)
  408. #define IDirectPlay2_GetMessageCount(p,a,b)         (p)->GetMessageCount(a,b)
  409. #define IDirectPlay2_GetGroupData(p,a,b,c,d)        (p)->GetGroupData(a,b,c,d)
  410. #define IDirectPlay2_GetGroupName(p,a,b,c)          (p)->GetGroupName(a,b,c)
  411. #define IDirectPlay2_GetPlayerAddress(p,a,b,c)      (p)->GetPlayerAddress(a,b,c)
  412. #define IDirectPlay2_GetPlayerCaps(p,a,b,c)         (p)->GetPlayerCaps(a,b,c)
  413. #define IDirectPlay2_GetPlayerData(p,a,b,c,d)       (p)->GetPlayerData(a,b,c,d)
  414. #define IDirectPlay2_GetPlayerName(p,a,b,c)         (p)->GetPlayerName(a,b,c)
  415. #define IDirectPlay2_GetSessionDesc(p,a,b)          (p)->GetSessionDesc(a,b)
  416. #define IDirectPlay2_Initialize(p,a)                (p)->Initialize(a)
  417. #define IDirectPlay2_Open(p,a,b)                    (p)->Open(a,b)
  418. #define IDirectPlay2_Receive(p,a,b,c,d,e)           (p)->Receive(a,b,c,d,e)
  419. #define IDirectPlay2_Send(p,a,b,c,d,e)              (p)->Send(a,b,c,d,e)
  420. #define IDirectPlay2_SetGroupData(p,a,b,c,d)        (p)->SetGroupData(a,b,c,d)
  421. #define IDirectPlay2_SetGroupName(p,a,b,c)          (p)->SetGroupName(a,b,c)
  422. #define IDirectPlay2_SetPlayerData(p,a,b,c,d)       (p)->SetPlayerData(a,b,c,d)
  423. #define IDirectPlay2_SetPlayerName(p,a,b,c)         (p)->SetPlayerName(a,b,c)
  424. #define IDirectPlay2_SetSessionDesc(p,a,b)          (p)->SetSessionDesc(a,b)
  425.  
  426. #endif
  427.  
  428. /****************************************************************************
  429.  *
  430.  * EnumPlayers API flags
  431.  *
  432.  ****************************************************************************/
  433.  
  434. /*
  435.  * Enumerate all players in the current session
  436.  */
  437. #define DPENUMPLAYERS_ALL           0x00000000
  438.  
  439. /*
  440.  * Enumerate only local (created by this application) players
  441.  */
  442. #define DPENUMPLAYERS_LOCAL         0x00000008
  443.  
  444. /*
  445.  * Enumerate only remote (non-local) players
  446.  */
  447. #define DPENUMPLAYERS_REMOTE        0x00000010
  448.  
  449. /*
  450.  * Enumerate groups along with the players
  451.  */
  452. #define DPENUMPLAYERS_GROUP         0x00000020
  453.  
  454. /*
  455.  * Enumerate players in another session (must supply lpguidInstance)
  456.  */
  457. #define DPENUMPLAYERS_SESSION       0x00000080
  458.  
  459.  
  460. /****************************************************************************
  461.  *
  462.  * EnumSessions API flags
  463.  *
  464.  ****************************************************************************/
  465.  
  466. /*
  467.  * Enumerate sessions which can be joined
  468.  */
  469. #define DPENUMSESSIONS_AVAILABLE    0x00000001 
  470.  
  471. /*
  472.  * Enumerate all sessions even if they can't be joined.
  473.  */
  474. #define DPENUMSESSIONS_ALL          0x00000002
  475.  
  476.  
  477.  
  478.  
  479.  
  480. /****************************************************************************
  481.  *
  482.  * GetCaps and GetPlayerCaps API flags
  483.  *
  484.  ****************************************************************************/
  485.  
  486. /*
  487.  * The latency returned should be for guaranteed message sending.
  488.  * Default is non-guaranteed messaging.
  489.  */
  490. #define DPGETCAPS_GUARANTEED        0x00000001 
  491.  
  492.  
  493. /****************************************************************************
  494.  *
  495.  * GetGroupData, GetPlayerData API flags
  496.  * Remote and local Group/Player data is maintained separately. 
  497.  * Default is DPGET_REMOTE.
  498.  *
  499.  ****************************************************************************/
  500.  
  501. /*
  502.  * Get the remote data (set by any DirectPlay object in
  503.  * the session using DPSET_REMOTE)
  504.  */
  505. #define DPGET_REMOTE                0x00000000
  506.  
  507. /*
  508.  * Get the local data (set by this DirectPlay object 
  509.  * using DPSET_LOCAL)
  510.  */
  511. #define DPGET_LOCAL                 0x00000001
  512.  
  513.  
  514. /****************************************************************************
  515.  *
  516.  * Open API flags
  517.  *
  518.  ****************************************************************************/
  519.  
  520. /*
  521.  * Join the session that is described by the DPSESSIONDESC2 structure
  522.  */
  523. #define DPOPEN_JOIN                 0x00000001
  524.  
  525. /*
  526.  * Create a new session as described by the DPSESSIONDESC2 structure
  527.  */
  528. #define DPOPEN_CREATE               0x00000002
  529.  
  530. /****************************************************************************
  531.  *
  532.  * Receive API flags
  533.  * Default is DPRECEIVE_ALL
  534.  *
  535.  ****************************************************************************/
  536.  
  537. /*
  538.  * Get the first message in the queue
  539.  */
  540. #define DPRECEIVE_ALL               0x00000001
  541.  
  542. /*
  543.  * Get the first message in the queue directed to a specific player 
  544.  */
  545. #define DPRECEIVE_TOPLAYER          0x00000002
  546.  
  547. /*
  548.  * Get the first message in the queue from a specific player
  549.  */
  550. #define DPRECEIVE_FROMPLAYER        0x00000004
  551.  
  552. /*
  553.  * Get the message but don't remove it from the queue
  554.  */
  555. #define DPRECEIVE_PEEK              0x00000008
  556.  
  557.  
  558. /****************************************************************************
  559.  *
  560.  * Send API flags
  561.  *
  562.  ****************************************************************************/
  563.  
  564. /*
  565.  * Send the message using a guaranteed send method.
  566.  * Default is non-guaranteed.
  567.  */
  568. #define DPSEND_GUARANTEED           0x00000001
  569.  
  570. /*
  571.  * Send the message high-priority. Move to front of
  572.  * send queue of sender and the receive queue of the
  573.  * receipient
  574.  */
  575. #define DPSEND_HIGHPRIORITY         0x00000002
  576.  
  577. /*
  578.  * Application will be sending several more guaranteed messages to
  579.  * this player so the service provider may want to optimize for this.
  580.  * Implementation of this flag by a service provider is optional.
  581.  */
  582. #define DPSEND_OPENSTREAM           0x00000008
  583.  
  584. /*
  585.  * The optimization requested by DPSEND_OPENSTREAM is no longer
  586.  * needed.  Resources allocated for DPSEND_OPENSTREAM may be released.
  587.  */
  588. #define DPSEND_CLOSESTREAM          0x00000010
  589.  
  590.  
  591. /****************************************************************************
  592.  *
  593.  * SetGroupData, SetGroupName, SetPlayerData, SetPlayerName,
  594.  * SetSessionDesc API flags.
  595.  * Default is DPSET_REMOTE.
  596.  *
  597.  ****************************************************************************/
  598.  
  599. /* 
  600.  * Propagate the data to all players in the session
  601.  */
  602. #define DPSET_REMOTE                0x00000000
  603.  
  604. /*
  605.  * Do not propagate the data to other players
  606.  */
  607. #define DPSET_LOCAL                 0x00000001
  608.  
  609. /*
  610.  * Used with DPSET_REMOTE, use guaranteed message send to
  611.  * propagate the data
  612.  */
  613. #define DPSET_GUARANTEED            0x00000002
  614.  
  615.  
  616. /****************************************************************************
  617.  *
  618.  * DirectPlay system messages and message data structures
  619.  *
  620.  * All system message come 'From' player DPID_SYSMSG.  To determine what type 
  621.  * of message it is, cast the lpData from Receive to DPMSG_GENERIC and check
  622.  * the dwType member against one of the following DPSYS_xxx constants. Once
  623.  * a match is found, cast the lpData to the corresponding of the DPMSG_xxx
  624.  * structures to access the data of the message.
  625.  *
  626.  ****************************************************************************/
  627.  
  628. /*
  629.  * A new player or group has been created in the session
  630.  * Use DPMSG_CREATEPLAYERORGROUP.  Check dwPlayerType to see if it
  631.  * is a player or a group.
  632.  */
  633. #define DPSYS_CREATEPLAYERORGROUP   0x0003  
  634.  
  635. /*
  636.  * A player has been deleted from the session
  637.  * Use DPMSG_DESTROYPLAYERORGROUP
  638.  */
  639. #define DPSYS_DESTROYPLAYERORGROUP  0x0005  
  640.  
  641. /*
  642.  * A player has been added to a group
  643.  * Use DPMSG_ADDPLAYERTOGROUP
  644.  */
  645. #define DPSYS_ADDPLAYERTOGROUP      0x0007  
  646.  
  647. /*
  648.  * A player has been removed from a group
  649.  * Use DPMSG_DELETEPLAYERFROMGROUP
  650.  */
  651. #define DPSYS_DELETEPLAYERFROMGROUP 0x0021  
  652.  
  653. /*
  654.  * This DirectPlay object lost its connection with all the
  655.  * other players in the session.
  656.  * Use DPMSG_SESSIONLOST.
  657.  */
  658. #define DPSYS_SESSIONLOST           0x0031
  659.  
  660. /*
  661.  * The current host has left the session.
  662.  * This DirectPlay object is now the host.
  663.  * Use DPMSG_HOST.
  664.  */
  665. #define DPSYS_HOST                  0x0101
  666.  
  667. /*
  668.  * The remote data associated with a player or
  669.  * group has changed. Check dwPlayerType to see
  670.  * if it is a player or a group
  671.  * Use DPMSG_SETPLAYERORGROUPDATA
  672.  */
  673. #define DPSYS_SETPLAYERORGROUPDATA  0x0102
  674.  
  675. /*
  676.  * The name of a player or group has changed.
  677.  * Check dwPlayerType to see if it is a player
  678.  * or a group.
  679.  * Use DPMSG_SETPLAYERORGROUPNAME
  680.  */
  681. #define DPSYS_SETPLAYERORGROUPNAME  0x0103
  682.  
  683. /*
  684.  * Used in the dwPlayerType field to indicate if it applies to a group
  685.  * or a player
  686.  */
  687. #define DPPLAYERTYPE_GROUP          0x00000000
  688. #define DPPLAYERTYPE_PLAYER         0x00000001
  689.  
  690. /*
  691.  * DPMSG_GENERIC
  692.  * Generic message structure used to identify the message type.
  693.  */
  694. typedef struct
  695. {
  696.     DWORD       dwType;         // Message type
  697. } DPMSG_GENERIC, FAR *LPDPMSG_GENERIC;
  698.  
  699. /*
  700.  * DPMSG_CREATEPLAYERORGROUP
  701.  * System message generated when a new player or group
  702.  * created in the session with information about it.
  703.  */
  704. typedef struct
  705. {
  706.     DWORD       dwType;         // Message type
  707.     DWORD       dwPlayerType;   // Is it a player or group
  708.     DPID        dpId;           // ID of the player or group
  709.     DWORD       dwCurrentPlayers;   // current # players & groups in session
  710.     LPVOID      lpData;         // pointer to remote data
  711.     DWORD       dwDataSize;     // size of remote data
  712.     DPNAME      dpnName;        // structure with name info
  713. } DPMSG_CREATEPLAYERORGROUP, FAR *LPDPMSG_CREATEPLAYERORGROUP;
  714.  
  715. /*
  716.  * DPMSG_DESTROYPLAYERORGROUP
  717.  * System message generated when a player or group is being
  718.  * destroyed in the session with information about it.
  719.  */
  720. typedef struct
  721. {
  722.     DWORD       dwType;         // Message type
  723.     DWORD       dwPlayerType;   // Is it a player or group
  724.     DPID        dpId;           // player ID being deleted
  725.     LPVOID      lpLocalData;    // copy of players local data
  726.     DWORD       dwLocalDataSize; // sizeof local data
  727.     LPVOID      lpRemoteData;   // copy of players remote data
  728.     DWORD       dwRemoteDataSize; // sizeof remote data
  729. } DPMSG_DESTROYPLAYERORGROUP, FAR *LPDPMSG_DESTROYPLAYERORGROUP;
  730.  
  731. /*
  732.  * DPMSG_ADDPLAYERTOGROUP
  733.  * System message generated when a player is being added
  734.  * to a group.
  735.  */
  736. typedef struct
  737. {
  738.     DWORD       dwType;         // Message type
  739.     DPID        dpIdGroup;      // group ID being added to
  740.     DPID        dpIdPlayer;     // player ID being added
  741. } DPMSG_ADDPLAYERTOGROUP, FAR *LPDPMSG_ADDPLAYERTOGROUP;
  742.  
  743. /*
  744.  * DPMSG_DELETEPLAYERFROMGROUP
  745.  * System message generated when a player is being
  746.  * removed from a group
  747.  */
  748. typedef DPMSG_ADDPLAYERTOGROUP          DPMSG_DELETEPLAYERFROMGROUP;
  749. typedef DPMSG_DELETEPLAYERFROMGROUP     FAR *LPDPMSG_DELETEPLAYERFROMGROUP;
  750.  
  751. /*
  752.  * DPMSG_SETPLAYERORGROUPDATA
  753.  * System message generated when remote data for a player or
  754.  * group has changed.
  755.  */
  756. typedef struct
  757. {
  758.     DWORD       dwType;         // Message type
  759.     DWORD       dwPlayerType;   // Is it a player or group
  760.     DPID        dpId;           // ID of player or group
  761.     LPVOID      lpData;         // pointer to remote data
  762.     DWORD       dwDataSize;     // size of remote data
  763. } DPMSG_SETPLAYERORGROUPDATA, FAR *LPDPMSG_SETPLAYERORGROUPDATA;
  764.  
  765. /*
  766.  * DPMSG_SETPLAYERORGROUPNAME
  767.  * System message generated when the name of a player or
  768.  * group has changed.
  769.  */
  770. typedef struct
  771. {
  772.     DWORD       dwType;         // Message type
  773.     DWORD       dwPlayerType;   // Is it a player or group
  774.     DPID        dpId;           // ID of player or group
  775.     DPNAME      dpnName;        // structure with new name info
  776. } DPMSG_SETPLAYERORGROUPNAME, FAR *LPDPMSG_SETPLAYERORGROUPNAME;
  777.  
  778. /*
  779.  * DPMSG_HOST
  780.  * System message generated when the host has migrated to this
  781.  * DirectPlay object.
  782.  *
  783.  */
  784. typedef DPMSG_GENERIC       DPMSG_HOST;
  785. typedef DPMSG_HOST          FAR *LPDPMSG_HOST;
  786.  
  787. /*
  788.  * DPMSG_SESSIONLOST
  789.  * System message generated when the connection to the session is lost.
  790.  *
  791.  */
  792. typedef DPMSG_GENERIC       DPMSG_SESSIONLOST;
  793. typedef DPMSG_SESSIONLOST   FAR *LPDPMSG_SESSIONLOST;
  794.  
  795. /****************************************************************************
  796.  *
  797.  * DIRECTPLAY ERRORS
  798.  *
  799.  * Errors are represented by negative values and cannot be combined.
  800.  *
  801.  ****************************************************************************/
  802. #define DP_OK                           S_OK
  803. #define DPERR_ALREADYINITIALIZED        MAKE_DPHRESULT(   5 )
  804. #define DPERR_ACCESSDENIED              MAKE_DPHRESULT(  10 )
  805. #define DPERR_ACTIVEPLAYERS             MAKE_DPHRESULT(  20 )
  806. #define DPERR_BUFFERTOOSMALL            MAKE_DPHRESULT(  30 )
  807. #define DPERR_CANTADDPLAYER             MAKE_DPHRESULT(  40 )
  808. #define DPERR_CANTCREATEGROUP           MAKE_DPHRESULT(  50 )
  809. #define DPERR_CANTCREATEPLAYER          MAKE_DPHRESULT(  60 )
  810. #define DPERR_CANTCREATESESSION         MAKE_DPHRESULT(  70 )
  811. #define DPERR_CAPSNOTAVAILABLEYET       MAKE_DPHRESULT(  80 )
  812. #define DPERR_EXCEPTION                 MAKE_DPHRESULT(  90 )
  813. #define DPERR_GENERIC                   E_FAIL
  814. #define DPERR_INVALIDFLAGS              MAKE_DPHRESULT( 120 )
  815. #define DPERR_INVALIDOBJECT             MAKE_DPHRESULT( 130 )
  816. #define DPERR_INVALIDPARAM              E_INVALIDARG
  817. #define DPERR_INVALIDPARAMS             DPERR_INVALIDPARAM
  818. #define DPERR_INVALIDPLAYER             MAKE_DPHRESULT( 150 )
  819. #define DPERR_NOCAPS                    MAKE_DPHRESULT( 160 )
  820. #define DPERR_NOCONNECTION              MAKE_DPHRESULT( 170 )
  821. #define DPERR_NOMEMORY                  E_OUTOFMEMORY
  822. #define DPERR_OUTOFMEMORY               DPERR_NOMEMORY
  823. #define DPERR_NOMESSAGES                MAKE_DPHRESULT( 190 )
  824. #define DPERR_NONAMESERVERFOUND         MAKE_DPHRESULT( 200 )
  825. #define DPERR_NOPLAYERS                 MAKE_DPHRESULT( 210 )
  826. #define DPERR_NOSESSIONS                MAKE_DPHRESULT( 220 )
  827. #define DPERR_SENDTOOBIG                MAKE_DPHRESULT( 230 )
  828. #define DPERR_TIMEOUT                   MAKE_DPHRESULT( 240 )
  829. #define DPERR_UNAVAILABLE               MAKE_DPHRESULT( 250 )
  830. #define DPERR_UNSUPPORTED               E_NOTIMPL
  831. #define DPERR_BUSY                      MAKE_DPHRESULT( 270 )
  832. #define DPERR_USERCANCEL                MAKE_DPHRESULT( 280 ) 
  833. #define DPERR_NOINTERFACE               E_NOINTERFACE
  834. #define DPERR_CANNOTCREATESERVER        MAKE_DPHRESULT( 290 )
  835. #define DPERR_PLAYERLOST                MAKE_DPHRESULT( 300 )
  836. #define DPERR_SESSIONLOST               MAKE_DPHRESULT( 310 )
  837.  
  838.  
  839. #define DPERR_BUFFERTOOLARGE            MAKE_DPHRESULT( 1000 )
  840. #define DPERR_CANTCREATEPROCESS         MAKE_DPHRESULT( 1010 )
  841. #define DPERR_APPNOTSTARTED             MAKE_DPHRESULT( 1020 )
  842. #define DPERR_INVALIDINTERFACE          MAKE_DPHRESULT( 1030 )
  843. #define DPERR_NOSERVICEPROVIDER         MAKE_DPHRESULT( 1040 )
  844. #define DPERR_UNKNOWNAPPLICATION        MAKE_DPHRESULT( 1050 )
  845. #define DPERR_NOTLOBBIED                MAKE_DPHRESULT( 1070 )
  846.  
  847.  
  848. /****************************************************************************
  849.  *
  850.  *      dplay 1.0 obsolete structures + interfaces
  851.  *      Included for compatibility only. New apps should
  852.  *      use IDirectPlay2
  853.  *
  854.  ****************************************************************************/
  855.  
  856. // define this to ignore obsolete interfaces and constants
  857. #ifndef IDIRECTPLAY2_OR_GREATER
  858.  
  859. #define DPOPEN_OPENSESSION          DPOPEN_JOIN
  860. #define DPOPEN_CREATESESSION        DPOPEN_CREATE
  861.  
  862. #define DPENUMSESSIONS_PREVIOUS     0x00000004
  863.  
  864. #define DPENUMPLAYERS_PREVIOUS      0x00000004
  865.  
  866. #define DPSEND_GUARANTEE            DPSEND_GUARANTEED
  867. #define DPSEND_TRYONCE              0x00000004
  868.  
  869. #define DPCAPS_NAMESERVICE          0x00000001
  870. #define DPCAPS_NAMESERVER           DPCAPS_ISHOST
  871. #define DPCAPS_GUARANTEED           0x00000004
  872.  
  873. #define DPLONGNAMELEN               52
  874. #define DPSHORTNAMELEN              20
  875. #define DPSESSIONNAMELEN            32
  876. #define DPPASSWORDLEN               16
  877. #define DPUSERRESERVED              16
  878.  
  879. #define DPSYS_ADDPLAYER             0x0003
  880. #define DPSYS_DELETEPLAYER          0x0005
  881.  
  882. #define DPSYS_DELETEGROUP           0x0020
  883. #define DPSYS_DELETEPLAYERFROMGRP   0x0021
  884. #define DPSYS_CONNECT               0x484b
  885.  
  886. typedef struct
  887. {
  888.     DWORD       dwType;
  889.     DWORD       dwPlayerType;
  890.     DPID        dpId;
  891.     char        szLongName[DPLONGNAMELEN];
  892.     char        szShortName[DPSHORTNAMELEN];
  893.     DWORD       dwCurrentPlayers;
  894. }   DPMSG_ADDPLAYER;
  895.  
  896. typedef DPMSG_ADDPLAYER DPMSG_ADDGROUP;
  897.  
  898. typedef struct
  899. {
  900.     DWORD       dwType;
  901.     DPID        dpIdGroup;
  902.     DPID        dpIdPlayer;
  903. } DPMSG_GROUPADD;
  904.  
  905. typedef DPMSG_GROUPADD DPMSG_GROUPDELETE;
  906. typedef struct
  907. {
  908.     DWORD       dwType;
  909.     DPID        dpId;
  910. } DPMSG_DELETEPLAYER;
  911.  
  912. typedef BOOL (PASCAL *LPDPENUMPLAYERSCALLBACK)(
  913.     DPID    dpId,
  914.     LPSTR   lpFriendlyName,
  915.     LPSTR   lpFormalName,
  916.     DWORD   dwFlags,
  917.     LPVOID  lpContext );
  918.  
  919. typedef struct
  920. {
  921.     DWORD   dwSize;
  922.     GUID    guidSession;                  
  923.     DWORD   dwSession;                    
  924.     DWORD   dwMaxPlayers;                 
  925.     DWORD   dwCurrentPlayers;             
  926.     DWORD   dwFlags;                      
  927.     char    szSessionName[DPSESSIONNAMELEN];
  928.     char    szUserField[DPUSERRESERVED];
  929.     DWORD   dwReserved1;                  
  930.     char    szPassword[DPPASSWORDLEN];    
  931.     DWORD   dwReserved2;                  
  932.     DWORD   dwUser1;
  933.     DWORD   dwUser2;
  934.     DWORD   dwUser3;
  935.     DWORD   dwUser4;
  936. } DPSESSIONDESC,*LPDPSESSIONDESC;
  937.  
  938. typedef BOOL (PASCAL * LPDPENUMSESSIONSCALLBACK)(
  939.     LPDPSESSIONDESC lpDPSessionDesc,
  940.     LPVOID      lpContext,
  941.     LPDWORD     lpdwTimeOut,
  942.     DWORD       dwFlags);
  943.  
  944. /*
  945.  * IDirectPlay
  946.  */
  947. #undef INTERFACE
  948. #define INTERFACE IDirectPlay
  949. DECLARE_INTERFACE_( IDirectPlay, IUnknown )
  950. {
  951.     /*** IUnknown methods ***/
  952.     STDMETHOD(QueryInterface)       (THIS_ REFIID riid, LPVOID * ppvObj) PURE;
  953.     STDMETHOD_(ULONG,AddRef)        (THIS)  PURE;
  954.     STDMETHOD_(ULONG,Release)       (THIS) PURE;
  955.     /*** IDirectPlay methods ***/
  956.     STDMETHOD(AddPlayerToGroup)     (THIS_ DPID, DPID) PURE;
  957.     STDMETHOD(Close)                (THIS) PURE;
  958.     STDMETHOD(CreatePlayer)         (THIS_ LPDPID,LPSTR,LPSTR,LPHANDLE) PURE;
  959.     STDMETHOD(CreateGroup)          (THIS_ LPDPID,LPSTR,LPSTR) PURE;
  960.     STDMETHOD(DeletePlayerFromGroup)(THIS_ DPID,DPID) PURE;
  961.     STDMETHOD(DestroyPlayer)        (THIS_ DPID) PURE;
  962.     STDMETHOD(DestroyGroup)         (THIS_ DPID) PURE;
  963.     STDMETHOD(EnableNewPlayers)     (THIS_ BOOL) PURE;
  964.     STDMETHOD(EnumGroupPlayers)     (THIS_ DPID, LPDPENUMPLAYERSCALLBACK,LPVOID,DWORD) PURE;
  965.     STDMETHOD(EnumGroups)           (THIS_ DWORD, LPDPENUMPLAYERSCALLBACK,LPVOID,DWORD) PURE;
  966.     STDMETHOD(EnumPlayers)          (THIS_ DWORD, LPDPENUMPLAYERSCALLBACK,LPVOID,DWORD) PURE;
  967.     STDMETHOD(EnumSessions)         (THIS_ LPDPSESSIONDESC,DWORD,LPDPENUMSESSIONSCALLBACK,LPVOID,DWORD) PURE;
  968.     STDMETHOD(GetCaps)              (THIS_ LPDPCAPS) PURE;
  969.     STDMETHOD(GetMessageCount)      (THIS_ DPID, LPDWORD) PURE;
  970.     STDMETHOD(GetPlayerCaps)        (THIS_ DPID, LPDPCAPS) PURE;
  971.     STDMETHOD(GetPlayerName)        (THIS_ DPID,LPSTR,LPDWORD,LPSTR,LPDWORD) PURE;
  972.     STDMETHOD(Initialize)           (THIS_ LPGUID) PURE;
  973.     STDMETHOD(Open)                 (THIS_ LPDPSESSIONDESC) PURE;
  974.     STDMETHOD(Receive)              (THIS_ LPDPID,LPDPID,DWORD,LPVOID,LPDWORD) PURE;
  975.     STDMETHOD(SaveSession)          (THIS_ LPSTR) PURE;
  976.     STDMETHOD(Send)                 (THIS_ DPID, DPID, DWORD, LPVOID, DWORD) PURE;
  977.     STDMETHOD(SetPlayerName)        (THIS_ DPID,LPSTR,LPSTR) PURE;
  978. };
  979.  
  980. /****************************************************************************
  981.  *
  982.  * IDirectPlay interface macros
  983.  *
  984.  ****************************************************************************/
  985.  
  986. #if !defined(__cplusplus) || defined(CINTERFACE)
  987.  
  988. #define IDirectPlay_AddPlayerToGroup(p,a,b)         (p)->lpVtbl->AddPlayerToGroup(p,a,b)
  989. #define IDirectPlay_Close(p)                        (p)->lpVtbl->Close(p)
  990. #define IDirectPlay_CreateGroup(p,a,b,c)            (p)->lpVtbl->CreateGroup(p,a,b,c)
  991. #define IDirectPlay_CreatePlayer(p,a,b,c,d)         (p)->lpVtbl->CreatePlayer(p,a,b,c,d)
  992. #define IDirectPlay_DeletePlayerFromGroup(p,a,b)    (p)->lpVtbl->DeletePlayerFromGroup(p,a,b)
  993. #define IDirectPlay_DestroyGroup(p,a)               (p)->lpVtbl->DestroyGroup(p,a)
  994. #define IDirectPlay_DestroyPlayer(p,a)              (p)->lpVtbl->DestroyPlayer(p,a)
  995. #define IDirectPlay_EnableNewPlayers(p,a)           (p)->lpVtbl->EnableNewPlayers(p,a)
  996. #define IDirectPlay_EnumGroupPlayers(p,a,b,c,d)     (p)->lpVtbl->EnumGroupPlayers(p,a,b,c,d)
  997. #define IDirectPlay_EnumGroups(p,a,b,c,d)           (p)->lpVtbl->EnumGroups(p,a,b,c,d)
  998. #define IDirectPlay_EnumPlayers(p,a,b,c,d)          (p)->lpVtbl->EnumPlayers(p,a,b,c,d)
  999. #define IDirectPlay_EnumSessions(p,a,b,c,d,e)       (p)->lpVtbl->EnumSessions(p,a,b,c,d,e)
  1000. #define IDirectPlay_GetCaps(p,a)                    (p)->lpVtbl->GetCaps(p,a)
  1001. #define IDirectPlay_GetMessageCount(p,a,b)          (p)->lpVtbl->GetMessageCount(p,a,b)
  1002. #define IDirectPlay_GetPlayerCaps(p,a,b)            (p)->lpVtbl->GetPlayerCaps(p,a,b)
  1003. #define IDirectPlay_GetPlayerName(p,a,b,c,d,e)      (p)->lpVtbl->GetPlayerName(p,a,b,c,d,e)
  1004. #define IDirectPlay_Initialize(p,a)                 (p)->lpVtbl->Initialize(p,a)
  1005. #define IDirectPlay_Open(p,a)                       (p)->lpVtbl->Open(p,a)
  1006. #define IDirectPlay_Receive(p,a,b,c,d,e)            (p)->lpVtbl->Receive(p,a,b,c,d,e)
  1007. #define IDirectPlay_SaveSession(p,a)                (p)->lpVtbl->SaveSession(p,a)
  1008. #define IDirectPlay_Send(p,a,b,c,d,e)               (p)->lpVtbl->Send(p,a,b,c,d,e)
  1009. #define IDirectPlay_SetPlayerName(p,a,b,c)          (p)->lpVtbl->SetPlayerName(p,a,b,c)
  1010.  
  1011. #else /* C++ */
  1012.  
  1013. #define IDirectPlay_AddPlayerToGroup(p,a,b)         (p)->AddPlayerToGroup(a,b)
  1014. #define IDirectPlay_Close(p)                        (p)->Close()
  1015. #define IDirectPlay_CreateGroup(p,a,b,c)            (p)->CreateGroup(a,b,c)
  1016. #define IDirectPlay_CreatePlayer(p,a,b,c,d)         (p)->CreatePlayer(a,b,c,d)
  1017. #define IDirectPlay_DeletePlayerFromGroup(p,a,b)    (p)->DeletePlayerFromGroup(a,b)
  1018. #define IDirectPlay_DestroyGroup(p,a)               (p)->DestroyGroup(a)
  1019. #define IDirectPlay_DestroyPlayer(p,a)              (p)->DestroyPlayer(a)
  1020. #define IDirectPlay_EnableNewPlayers(p,a)           (p)->EnableNewPlayers(a)
  1021. #define IDirectPlay_EnumGroupPlayers(p,a,b,c,d)     (p)->EnumGroupPlayers(a,b,c,d)
  1022. #define IDirectPlay_EnumGroups(p,a,b,c,d)           (p)->EnumGroups(a,b,c,d)
  1023. #define IDirectPlay_EnumPlayers(p,a,b,c,d)          (p)->EnumPlayers(a,b,c,d)
  1024. #define IDirectPlay_EnumSessions(p,a,b,c,d,e)       (p)->EnumSessions(a,b,c,d,e)
  1025. #define IDirectPlay_GetCaps(p,a)                    (p)->GetCaps(a)
  1026. #define IDirectPlay_GetMessageCount(p,a,b)          (p)->GetMessageCount(a,b)
  1027. #define IDirectPlay_GetPlayerCaps(p,a,b)            (p)->GetPlayerCaps(a,b)
  1028. #define IDirectPlay_GetPlayerName(p,a,b,c,d,e)      (p)->GetPlayerName(a,b,c,d,e)
  1029. #define IDirectPlay_Initialize(p,a)                 (p)->Initialize(a)
  1030. #define IDirectPlay_Open(p,a)                       (p)->Open(a)
  1031. #define IDirectPlay_Receive(p,a,b,c,d,e)            (p)->Receive(a,b,c,d,e)
  1032. #define IDirectPlay_SaveSession(p,a)                (p)->SaveSession(a)
  1033. #define IDirectPlay_Send(p,a,b,c,d,e)               (p)->Send(a,b,c,d,e)
  1034. #define IDirectPlay_SetPlayerName(p,a,b,c)          (p)->SetPlayerName(a,b,c)
  1035.  
  1036. #endif
  1037.  
  1038. DEFINE_GUID(IID_IDirectPlay, 0x5454e9a0, 0xdb65, 0x11ce, 0x92, 0x1c, 0x00, 0xaa, 0x00, 0x6c, 0x49, 0x72);
  1039.  
  1040. #endif // IDIRECTPLAY2_OR_GREATER
  1041.  
  1042. /****************************************************************************
  1043.  *
  1044.  * IDirectPlay macros (included regardless of IDIRECTPLAY2_OR_GREATER flag)
  1045.  *
  1046.  ****************************************************************************/
  1047.  
  1048. #if !defined(__cplusplus) || defined(CINTERFACE)
  1049.  
  1050. #define IDirectPlay_QueryInterface(p,a,b)           (p)->lpVtbl->QueryInterface(p,a,b)
  1051. #define IDirectPlay_AddRef(p)                       (p)->lpVtbl->AddRef(p)
  1052. #define IDirectPlay_Release(p)                      (p)->lpVtbl->Release(p)
  1053.  
  1054. #else
  1055.  
  1056. #define IDirectPlay_QueryInterface(p,a,b)           (p)->QueryInterface(a,b)
  1057. #define IDirectPlay_AddRef(p)                       (p)->AddRef()
  1058. #define IDirectPlay_Release(p)                      (p)->Release()
  1059.  
  1060. #endif // IDirectPlay interface macros 
  1061.  
  1062. #ifdef __cplusplus
  1063. };
  1064. #endif
  1065.  
  1066. #endif
  1067.